<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改会员特权')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-privilegepackage-edit" th:object="${privilegePackage}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">应用ID：</label>
                <div class="col-sm-8">
                    <select name="appId" class="form-control m-b" th:with="type=${@dict.getType('storage_app_type')}" disabled>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{appId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">金额(分)：</label>
                <div class="col-sm-8">
                    <input name="fee" th:field="*{fee}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">时间：</label>
                <div class="col-sm-8">
                    <input name="period" th:field="*{period}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">折扣金额(分)：</label>
                <div class="col-sm-8">
                    <input name="discountFee" th:field="*{discountFee}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">自动续费：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('common_support')}">
                        <input type="radio" th:id="${'autoRenew_' + dict.dictCode}" name="autoRenew" th:value="${dict.dictValue}" th:field="*{autoRenew}">
                        <label th:for="${'autoRenew_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">特权类型：</label>
                <div class="col-sm-8">
                    <select name="type" class="form-control m-b" th:with="type=${@dict.getType('member_privilege_type')}" disabled>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">特权时间(月)：</label>
                <div class="col-sm-8">
                    <input name="month" th:field="*{month}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">特权时间(月)(赠送)：</label>
                <div class="col-sm-8">
                    <input name="giftMonth" th:field="*{giftMonth}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">最低版本：</label>
                <div class="col-sm-8">
                    <input name="minVersion" th:field="*{minVersion}" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "member/privilegepackage";
        $("#form-privilegepackage-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-privilegepackage-edit').serialize());
            }
        }
    </script>
</body>
</html>